.TH std::allocator_traits::select_on_container_copy_construction 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::allocator_traits::select_on_container_copy_construction \- std::allocator_traits::select_on_container_copy_construction

.SH Synopsis
   Defined in header <memory>
   static Alloc select_on_container_copy_construction( const Alloc& a );  \fI(since C++11)\fP
                                                                          \fI(until C++20)\fP
   static constexpr Alloc select_on_container_copy_construction( const    \fI(since C++20)\fP
   Alloc& a );

   If possible, obtains the copy-constructed version of the allocator a, by calling
   a.select_on_container_copy_construction(). If the above is not possible (e.g. Alloc
   does not have the member function select_on_container_copy_construction()), then
   returns a, unmodified.

   This function is called by the copy constructors of all standard library containers.
   It allows the allocator used by the constructor's argument to become aware that the
   container is being copied and modify state if necessary.

.SH Parameters

   a - allocator used by a standard container passed as an argument to a container copy
       constructor

.SH Return value

   The allocator to use by the copy-constructed standard containers.

.SH See also

                                      copies the state of scoped_allocator_adaptor and all its
                                      allocators
select_on_container_copy_construction \fI\fI(public member\fP function of\fP
                                      std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>)

